package com.rzw.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.rzw.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by DELL on 2017/9/21.
 */
@Controller
@RequestMapping("/user")
public class UserController {
    @RequestMapping("test1")
    @ResponseBody
    public String excute(HttpServletRequest request, HttpServletResponse response,User user){
        System.out.println("执行：--------------------------");;
        JSONObject jsonUser = (JSONObject)JSON.toJSON(user);
        String s = jsonUser.toString();
        System.out.println(s+"--------");
        return jsonUser.toString();
    }
}
